package com.czxy.demo13;

import java.util.ArrayList;

public class Test01 {
    public static void main(String[] args) {

        Employee e1 = new Employee("小明",1800);
        Employee e2 = new Employee("小新",2600);

        ArrayList<Employee> list = new ArrayList<>();
        list.add(e1);
        list.add(e2);

        for (Employee emp : list) {
            if (emp.getName().equals("小明")){
                emp.setSalary(emp.getSalary()+300);
            }
        }
        System.out.println(list);
    }
}
